import sys


def int2complement(a, len=32):
    ret = ""
    for i in range(len - 1, -1, -1):
        if (a >> i) & 1:
            ret += "1"
        else:
            ret += "0"
    return ret


for line in sys.stdin.readlines():
    x = int(line.strip())
    print(int2complement(x))
    print(int2complement(~x))
    print(int2complement(x << 1))
    print(int2complement(x >> 1))
    print()
